home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / linux / atari / source / source.lzh / atari-linux-0.01pl3 / kernel / panic.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-05  |  932 b   |  44 lines

  1. /*
  2.  *  linux/kernel/panic.c
  3.  *
  4.  *  Copyright (C) 1991, 1992  Linus Torvalds
  5.  *
  6.  * This file is subject to the terms and conditions of the GNU General Public
  7.  * License.  See the file README.legal in the main directory of this archive
  8.  * for more details.
  9.  */
  10.  
  11. /*
  12.  * This function is used through-out the kernel (including mm and fs)
  13.  * to indicate a major problem.
  14.  */
  15.  
  16. #include <stdarg.h>
  17.  
  18. #include <asm/system.h>
  19. #include <asm/segment.h>
  20.  
  21. #include <linux/kernel.h>
  22. #include <linux/sched.h>
  23.  
  24. asmlinkage void sys_sync(void); /* it's really int */
  25.  
  26. extern int vsprintf(char * buf, const char * fmt, va_list args);
  27.  
  28. NORET_TYPE void panic(const char * fmt, ...)
  29. {
  30.     static char buf[1024];
  31.     va_list args;
  32.  
  33.     va_start(args, fmt);
  34.     vsprintf(buf, fmt, args);
  35.     va_end(args);
  36.     printk(KERN_EMERG "Kernel panic: %s\n",buf);
  37.     if (current == task[0])
  38.         printk(KERN_EMERG "In swapper task - not syncing\n");
  39.     else
  40.         sys_sync();
  41.     cli();
  42.     for(;;);
  43. }
  44.